package LC0448;

import java.util.*;

public class Solution2 {
    // HashMap
    public List<Integer> findDisappearedNumbers(int[] nums) {
        List<Integer> unseen = new ArrayList<Integer>();

        Map<Integer, Boolean> temp = new HashMap<>();

        for (Integer i: nums){
            temp.put(i, false);
        }

        for (int i = 1; i <= nums.length; i++){
            if (!temp.containsKey(i)) {     // TODO .containsKey()的用法
                unseen.add(i);
            }
        }

        return unseen;
    }
}
